<template>
  <div class="icon">
    <vab-icon
      v-if="theme.showRefresh"
      icon="refresh-line"
      @click="refreshRoute"
    />
  </div>
</template>

<script>
  import { mapGetters } from 'vuex'

  export default {
    name: 'VabRefresh',
    computed: {
      ...mapGetters({
        theme: 'settings/theme',
        extra: 'settings/extra',
        visitedRoutes: 'tabs/visitedRoutes',
      }),
    },
    methods: {
      async refreshRoute() {
        this.$baseEventBus.$emit('reload-router-view')
      },
    },
  }
</script>

<style lang="scss" scoped>
  .icon {
    width: 54px;
    height: 54px;
    margin-left: 15px;
    line-height: 54px;
    vertical-align: middle;
    background-color: #fff;
    border-radius: 50%;
  }
</style>
